package thread.test03;

/**
 * ClassName: MainTest
 * Description:
 *
 * @Author zjl
 * @Create 2025/03/10 19:28
 * @Version 1.0
 */
public class MainTest {
    public static void main(String[] args) throws Exception {
        SumThread st1 = new SumThread(1, 100);
        SumThread st2 = new SumThread(101, 900);
        SumThread st3 = new SumThread(901, 1000);

        st1.start();
        st2.start();
        st3.start();

        st1.join();
        st2.join();
        st3.join();

        int totalSum = st1.getSum() + st2.getSum() + st3.getSum();
        System.out.println("结果:" + totalSum);
    }
}
